package gh.request.net.revert;

import java.io.Serializable;

import gh.request.utitls.ApiConfig;

public class BaseResponseEntity implements Serializable {
    public int code= -1;

    private String msg = "";

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
    //    companion object {
//        private const val serialVersionUID = 1L
//    }

    /**
     * 请求成功返回
     */
    public boolean success() {
        return ApiConfig.getSucceedCode() == code;
    }

    /**
     * 请求返回token失效的code
     */
    public boolean tokenInvalid() {
        return ApiConfig.getInvalidToken() == code;
    }

    /**
     * 请求返回退出APP的code
     */
    public boolean quitApp() {
        return ApiConfig.getQuitCode() == code;
    }
}
